let bus = {
    list:[],
    emit(name,msg){
    let index = this.list.findIndex((item)=>{
        return item.name ===name;
    })
    if(index!==-1){
        this.list[index].callBack(msg)
    }
    },
    on(name,callBack){
        let obj = {
            name,
            callBack
        }
        this.list.push(obj)
    }
}

export default bus;